gdkwindow: check grab window and children on get_pointer_window()
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 16 Sep 2014 15:14:09 +0000 (17:14 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 23 Sep 2014 00:30:12 +0000 (20:30 -0400)
If !owner_events, the pointer window has been usually set to NULL if
the pointer fell outside the grabbing widget, but it was not being
checked that the pointer_window is actually a child of the grab
window, in which case it should be obtained as if ungrabbed.

https://bugzilla.gnome.org/show_bug.cgi?id=735749

gdk/gdkwindow.c

index 0460ffca81f90230bb4161c686f192f33d64bbc6..e023042ca7f52ed865c1af82c9193608df72a4ea 100644 (file)
@@ -7623,7 +7623,8 @@ get_pointer_window (GdkDisplay *display,
   grab = _gdk_display_has_device_grab (display, device, serial);
   if (grab != NULL &&
       !grab->owner_events &&
-      pointer_window != grab->window)
+      pointer_window != grab->window &&
+      !gdk_window_is_ancestor (pointer_window, grab->window))
     pointer_window = NULL;
 
   return pointer_window;